package com.app.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
@Aspect
public class UserAop {
    @Before(value = "execution(* com.app.controller.UserController.loginUser(..))")
    void login(){
        System.out.println("登录！");
    }

    @Before(value = "execution(* com.app.controller.UserController.userRegister(..))")
    public void register(){
        System.out.println("注册！");
    }
    @Before(value = "execution(* com.app.controller.UserController.getUserInfo(..))")
    void getUserInfo(){
        System.out.println("用户信息！");
    }
    @Before(value = "execution(* com.app.controller.UserController.*(..))")
    public void aopTest(){
        System.out.println("Before aopTest！");
    }
}
